import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const store = new Vuex.Store({
  state: {
    user: {}
  },
  mutations: {
    setOpenId:(state, data) => {
      state.user.openid = data
    },
    getUser: (state, data) => {
      state.user = data
    },
    updateBaseInfo: (state, data) => {
      state.user.base = data
    },
    updateDetailInfo: (state, data) => {
      state.user.detail = data
    },
    updatePhoto: (state, data) => {
      state.user.photo = data
    }
  }
})
export default store
